const HomeModel = {
  namespace: 'home',
  state: {
    Full_Chart_Type: null, //全屏查看类型
    ModelVisible: false, //Side全屏查看
    visiable: false,
  },
  effects: {
    *ChangeModelVisibleEffect({ payload }, { call, put }) {
      const { chart_type, ModelVisible } = payload;
      yield put({
        type: 'changeModelVisible',
        payload: {
          chart_type: chart_type,
          ModelVisible: ModelVisible,
        },
      });
    },
  },
  reducers: {
    changeModelVisible(state, { payload }) {
      return {
        ...state,
        ModelVisible: payload.ModelVisible,
        Full_Chart_Type: payload.chart_type,
      };
    },

    changeVisible(state) {
      return {
        ...state,
        visiable: !state.visiable,
      };
    },
  },
};

export default HomeModel;
